#使用示例
#source ./vllm/set_env_vllm_ascend.sh ./vllm/vllm_config.yaml
#取消某环境需要 unset

if [ -z "$CONFIG_FILE" ]; then
	export CONFIG_FILE=$1
fi
source ../src/read_config.sh

if [ -z "$HCCL_IF_IP" ]; then
	echo "HCCL_IF_IP should be set"
	exit 1
fi

if [[ $NUM_NPU =~ ^[0-9]+$ ]]; then
    export ASCEND_RT_VISIBLE_DEVICES=$(seq -s, 0 $(($NUM_NPU - 1)))
fi

export GLOO_SOCKET_IFNAME=$GLOO_SOCKET_IFNAME
export TP_SOCKET_IFNAME=$TP_SOCKET_IFNAME
export RAY_EXPERIMENTAL_NOSET_ASCEND_RT_VISIBLE_DEVICES=$RAY_EXPERIMENTAL_NOSET_ASCEND_RT_VISIBLE_DEVICES
export ASCEND_PROCESS_LOG_PATH=$ASCEND_PROCESS_LOG_PATH

echo HCCL_IF_IP:$HCCL_IF_IP
echo ASCEND_RT_VISIBLE_DEVICES:$ASCEND_RT_VISIBLE_DEVICES